const dataBase = require('../dataBase')

// 修改通知信息处理函数
function putNotificationInformation(req, res){
    

    const putNotificationInformationSql = 'update notificationinformation set text = ? where id = 1;'

    dataBase.query(putNotificationInformationSql, req.body.newNotificationInformation, (err, results) => {
        if(err){
            return res.ErrorFun('未知错误！请稍后重试！')
        }

        if(results.affectedRows !== 1){
            return res.ErrorFun('修改失败！')
        }

        res.send({
            status: 200,
            message: '修改成功！'
        })
    })
}

module.exports = {
    putNotificationInformation
}